package com.haiyangwang1.lesson2;


    public class Hourly extends Employee {
        public float hourlyRate; //每⼩时报酬
        public float hoursWorked; //每⽉⼯作时间

        public float computePay() {
            System.out.println("计算按时付酬员⼯" + this.name + "的薪⽔");
            float pay = 0.0F;
            if (this.hoursWorked <= 40) {

                pay = this.hourlyRate * this.hoursWorked;
            } else { //需要计算加班
                pay = (this.hourlyRate * 40) + (this.hourlyRate * (this.hoursWorked - 40) * 1.5F);
            }
            return pay;
        }
    }